进行合规注册 [英] Make Compliant register

查看:75
本文介绍了进行合规注册的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

1)您必须制作一个兼容的寄存器.
符合标准(CompliantID,Comp.Date,IpAdress,ProblemDesc,Resp)
合规ID将自动生成为...如果是响应.是从M001开始的管理方式..
如果网络人负责从N001开始,而其他人负责从O001开始.
在连接的体系结构中

[edit]删除了虚假的SQL代码块,将我的内容作为纯文本..."选项已禁用,
主题已更改:请我需要代码[c#,windows]"没有描述问题. -OriginalGriff [/edit]

1) You have to make a compliant register.
Compliants(CompliantID,Comp.Date,IpAdress,ProblemDesc,Resp)
Compliant ID to be generated automatically as… If Resp. is Management Start with M001 like that..
If Network Person is responsible start with N001 if Others are responsible start with O001 like that.
In connected architecture

[edit]Spurious SQL code block removed, "Treat my content as plain text..." option disabled,
Subject changed: "pls i need code [c#,windows]" does not describe the problem. - OriginalGriff[/edit]

推荐答案

/* HElp me out with this code */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Text;

namespace compliants
{

    #region class compliants

    class compliants
    {
        #region variables
        SqlConnection connection;
         SqlCommand command;
        SqlDataReader dr;
      
        #endregion variables

        #region properties
        public int ID
        { get;
          set; 
        }
        public string compliantID
        {
            get;
            set;
        }
        public DateTime compliantDate
        {
            get;
            set;
        }
        public string IpAddress
        {
            get;
            set;
        }
        public string ProblemDescription
        {
            get;
            set;
        }
       
        public string Responsibility
        {
            get;
            set;

        }       
       
        #endregion properties


        #region methods
        public void Savecompliants(compliants objcompliants)
        {
            
            compliantID = objcompliants.compliantID;
           compliantDate = objcompliants.compliantDate;
            IpAddress = objcompliants.IpAddress;
            ProblemDescription = objcompliants.ProblemDescription;
            Responsibility = objcompliants.Responsibility;
        }
      
     /*   public string GenerateID(String compliantID)
        {

            connection = connectionHelper.GetConnection();
            SqlCommand cmd = new SqlCommand("select top 1 CompliantID from Compliants where CompliantID like ''" + compliantID + "%'' order by ID DESC",connection);
            connection.Open();
            string c = compliantID;

            object b = command.ExecuteScalar();
            string num = "";
            if (b == null)
            {
                num = c + "001";
            }
            else
            {

               num = b.ToString();
                int n=Convert.ToInt32(num.Substring(1,num.Length-1));
                n++;
                if (n >= 1 && n <= 9)
                   num = c+"00"+n;
                if (n >= 10 && n <= 99)
                    num = c+"0"+n;
                if (n >= 100 && n <= 999)
                   num = c+n;
               }
            connection.Close();
            return compliantID;
        }*/
        public string Insertcompliants()
        { 
          
            connection = connectionHelper.GetConnection();
             command = new SqlCommand("proccomplaint", connection);
             connection.Open();
            command.CommandType = CommandType.StoredProcedure;
            command.Parameters.AddWithValue("@compliantID",compliantID);
            command.Parameters.AddWithValue("@CompliantDate",compliantDate);
            command.Parameters.AddWithValue("@IpAddress",IpAddress);
            command.Parameters.AddWithValue("@ProblemDescription",ProblemDescription);
            command.Parameters.AddWithValue("@Responsibility",Responsibility);
           
            command.ExecuteNonQuery();
           
            string compliantid =Convert.ToString(command.Parameters["@CompliantID"].Value);
            return compliantid;
        }
        #endregion methods
    }

    #endregion class compliants

}


这篇关于进行合规注册的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆