コード例 #1
0
        public static String userload(string timeid, string subject)
        {
            DataSet ds;
            //WindowsPrincipal wp = new WindowsPrincipal(WindowsIdentity.GetCurrent());
            //string fulluser = wp.Identity.Name;
            //int idx = fulluser.IndexOf("\\");

            string alias = "dnot";

            if (timeid != null)
            {
                if (subject != null && subject.ToLower().IndexOf("x1annotation") >= 0)
                {
                    ds = DBTalk.GetSIDataSet("co2infsrvidb803", "XONE", true, "p_annotation_load", DBTalk.FormulateSqlParameter(new string[2] {
                        timeid, subject
                    }));
                }
                else
                {
                    ds = DBTalk.GetSIDataSet("CO2INFAUDTDB801", "portal", true, "p_annotation_load", DBTalk.FormulateSqlParameter(new string[2] {
                        timeid, subject
                    }));
                }


                if (ds.Tables[0].Rows.Count != 0)
                {
                    DataRow dr = ds.Tables[0].Rows[0];
                    //txtAnnotation.Text
                    var annotation  = dr[0].ToString();
                    var subjectline = dr[2].ToString();
                    //txtEnter.Text
                    alias = dr[1].ToString();
                    return(annotation + ":$:" + alias + ":$:" + subjectline);
                }
            }

            return(":$:" + alias + ":$:");
        }
コード例 #2
0
 public static string userdelete(string timeid, string annotation, string enterby, string subject)
 {
     try
     {
         if (subject != null && subject.ToLower().IndexOf("x1annotation") >= 0)
         {
             DBTalk.UpdateData("co2infsrvidb803", "XONE", true, "p_annotation_delete", DBTalk.FormulateSqlParameter(new string[4] {
                 timeid, annotation, enterby, subject
             }));
         }
         else
         {
             DBTalk.UpdateData("CO2INFAUDTDB801", "portal", true, "p_annotation_delete", DBTalk.FormulateSqlParameter(new string[4] {
                 timeid, annotation, enterby, subject
             }));
         }
     }
     catch
     {
         // do nothing
     }
     return("ok");
 }