Write() public static method

public static Write ( string s ) : void
s string
return void
示例#1
0
    /// <summary>
    /// Writes the value in the packet
    /// </summary>
    /// <param name="value">value to write</param>
    public void Write(string value)
    {
        int n = Utils.Write(Data, CurrentSeek, value);

        CurrentSeek   += n;
        CurrentLength += n;
    }
示例#2
0
文件: DP.cs 项目: Namrata2392/OPP
 public DP(string dpName, List <KeyValuePair <string, string> > dpData)
 {
     SetSupportedOperations();
     rnName = dpName;
     //Parse n store values...
     if (dpData != null && dpData.Count > 0)
     {
         foreach (KeyValuePair <string, string> dpkp in dpData)
         {
             Utils.Write(VerboseLevel.DEBUG, "{0} {1} ", dpkp.Key, dpkp.Value);
             try
             {
                 if (this.GetType().GetProperty(dpkp.Key) != null) //Ajay: 03/07/2018
                 {
                     this.GetType().GetProperty(dpkp.Key).SetValue(this, dpkp.Value);
                 }
             }
             catch (System.NullReferenceException)
             {
                 Utils.WriteLine(VerboseLevel.WARNING, "Field doesn't exist. XML and class fields mismatch!!! key: {0} value: {1}", dpkp.Key, dpkp.Value);
             }
         }
         Utils.Write(VerboseLevel.DEBUG, "\n");
     }
 }
示例#3
0
        public void updateAttributes(List <KeyValuePair <string, string> > mbsData)
        {
            string strRoutineName = "updateAttributes";

            try
            {
                if (mbsData != null && mbsData.Count > 0)
                {
                    foreach (KeyValuePair <string, string> mbskp in mbsData)
                    {
                        Utils.Write(VerboseLevel.DEBUG, "{0} {1} ", mbskp.Key, mbskp.Value);
                        try
                        {
                            if (this.GetType().GetProperty(mbskp.Key) != null) //Ajay: 03/07/2018
                            {
                                this.GetType().GetProperty(mbskp.Key).SetValue(this, mbskp.Value);
                            }
                        }
                        catch (System.NullReferenceException)
                        {
                            Utils.WriteLine(VerboseLevel.WARNING, "Field doesn't exist. XML and class fields mismatch!!! key: {0} value:{1}", mbskp.Key, mbskp.Value);
                        }
                    }
                    Utils.Write(VerboseLevel.DEBUG, "\n");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(strRoutineName + ": " + "Error: " + ex.Message.ToString(), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        public void updateAttributes(List <KeyValuePair <string, string> > mbData)
        {
            if (mbData != null && mbData.Count > 0)
            {
                foreach (KeyValuePair <string, string> mbkp in mbData)
                {
                    Utils.Write(VerboseLevel.DEBUG, "{0} {1} ", mbkp.Key, mbkp.Value);
                    try
                    {
                        if (this.GetType().GetProperty(mbkp.Key) != null) //Ajay: 10/08/2018
                        {
                            this.GetType().GetProperty(mbkp.Key).SetValue(this, mbkp.Value);
                        }
                    }
                    catch (System.NullReferenceException)
                    {
                        Utils.WriteLine(VerboseLevel.WARNING, "Field doesn't exist. XML and class fields mismatch!!! key: {0} value: {1}", mbkp.Key, mbkp.Value);
                    }
                }
                Utils.Write(VerboseLevel.DEBUG, "\n");
            }

            ucmod.lblIED.Text = "IED List (Master No: " + this.MasterNum + ")";
            if (MODBUSTreeNode != null)
            {
                MODBUSTreeNode.Text = "MODBUS " + this.Description;
            }
        }
        public void ObtenerEmpresa(int IdEmpresa)
        {
            try
            {
                var model = Mantenimiento.ListaEditEmpresa(IdEmpresa);
                if (model.Logo == "" || model.Certificado == "")
                {
                    model.Logo        = $"/Imagenes/Empresa/LogoDefault.png";
                    model.Certificado = $"";
                }
                else
                {
                    model.Logo        = $"/Imagenes/Empresa/{model.Logo}";
                    model.Certificado = $"/Certificado/{model.Certificado}";
                }

                Utils.Write(ResponseType.JSON, model);
            }
            catch (Exception Exception)
            {
                Utils.Write(
                    ResponseType.JSON,
                    "{ Code: 1, ErrorMessage: \"" + Exception.Message + "\" }"
                    );
            }
        }
示例#6
0
 public byte[] GetBytes(ID3v2TagVersion tagVersion)
 {
     if (this.Items.Count == 0)
     {
         return(new byte[0]);
     }
     using (MemoryStream stream1 = new MemoryStream())
     {
         stream1.WriteByte((byte)this.m_TextEncoding);
         bool flag1 = false;
         using (IEnumerator <IInvolvedPerson> enumerator1 = this.Items.GetEnumerator())
         {
             while (enumerator1.MoveNext())
             {
                 IInvolvedPerson person1 = enumerator1.Current;
                 if (!string.IsNullOrEmpty(person1.Involvement) || !string.IsNullOrEmpty(person1.Name))
                 {
                     Utils.Write(stream1, Utils.GetStringBytes(tagVersion, this.m_TextEncoding, person1.Involvement, true));
                     Utils.Write(stream1, Utils.GetStringBytes(tagVersion, this.m_TextEncoding, person1.Name, true));
                     flag1 = true;
                 }
             }
         }
         if (!flag1)
         {
             return(new byte[0]);
         }
         return(this.m_FrameHeader.GetBytes(stream1, tagVersion, this.GetFrameID(tagVersion)));
     }
 }
        public static JsonResults GetMeasurementList(string AccountCode, string AccountName, string DeliveryFrom, string DeliveryTo)
        {
            JsonResults MeasurList = new JsonResults();
            LoginUser   currentUser;

            try
            {
                if (!GetUserSession(out currentUser))
                {
                    MeasurList.ErrorCode    = 1001;
                    MeasurList.ErrorMessage = "";
                    return(MeasurList);
                }

                CustomerManager customerObj = new CustomerManager();
                if (customerObj.GetMeasurementList(currentUser.CompanyID, currentUser.UserId, currentUser.UserBranchID, AccountCode, AccountName, DeliveryFrom, DeliveryTo, out MeasurList))
                {
                    MeasurList.ErrorCode    = 0;
                    MeasurList.ErrorMessage = "";
                }
                else
                {
                    MeasurList.ErrorCode    = -1;
                    MeasurList.ErrorMessage = "Failed to get Employee List. please try again later";
                }
            }
            catch (Exception ex)
            {
                Utils.Write(ex);
            }
            return(MeasurList);
        }
        public static JsonResults GetCustomerList(string BirthDate)
        {
            JsonResults custList = new JsonResults();
            LoginUser   currentUser;

            try
            {
                if (!GetUserSession(out currentUser))
                {
                    custList.ErrorCode    = -1001;
                    custList.ErrorMessage = "";
                }

                CustomerManager customerObj = new CustomerManager();
                if (customerObj.GetCustomerList(currentUser.CompanyID, currentUser.UserId, BirthDate, out custList))
                {
                    custList.ErrorCode    = 0;
                    custList.ErrorMessage = "";
                }
                else
                {
                    custList.ErrorCode    = -1;
                    custList.ErrorMessage = "Failed to get Customer List. please try again later";
                }
            }
            catch (Exception ex)
            {
                Utils.Write(ex);
            }

            return(custList);
        }
示例#9
0
        public static JsonResults GetSeriesMaster(int SeriesMasterID)
        {
            JsonResults SeriesList = new JsonResults();
            LoginUser   currentUser;

            try
            {
                if (!GetUserSession(out currentUser))
                {
                    SeriesList.ErrorCode    = 1001;
                    SeriesList.ErrorMessage = "";
                }

                AdminManagerSP customerObj = new AdminManagerSP();
                if (customerObj.GetSeriesMaster(currentUser.CompanyID, currentUser.UserId, currentUser.UserBranchID, SeriesMasterID, out SeriesList))
                {
                    SeriesList.ErrorCode    = 0;
                    SeriesList.ErrorMessage = "";
                }
                else
                {
                    SeriesList.ErrorCode    = -1;
                    SeriesList.ErrorMessage = "Failed to get Series List. please try again later";
                }
            }
            catch (Exception ex)
            {
                Utils.Write(ex);
            }

            return(SeriesList);
        }
        public static JsonResults GetEmployeeList()
        {
            JsonResults emplList = new JsonResults();
            LoginUser   currentUser;

            try
            {
                if (!GetUserSession(out currentUser))
                {
                    emplList.ErrorCode    = 1001;
                    emplList.ErrorMessage = "";
                }

                AdminManagerSP customerObj = new AdminManagerSP();
                if (customerObj.GetEmployeeList(currentUser.CompanyID, currentUser.UserId, false, out emplList))
                {
                    emplList.ErrorCode    = 0;
                    emplList.ErrorMessage = "";
                }
                else
                {
                    emplList.ErrorCode    = -1;
                    emplList.ErrorMessage = "Failed to get Employee List. please try again later";
                }
            }
            catch (Exception ex)
            {
                Utils.Write(ex);
            }

            return(emplList);
        }
        public static CustomerMaster GetCustomerDetails(string customerID)
        {
            CustomerMaster CustomerDetails = new CustomerMaster();
            LoginUser      currentUser;

            try
            {
                if (!GetUserSession(out currentUser))
                {
                    CustomerDetails.ErrorCode    = -1001;
                    CustomerDetails.ErrorMessage = "";
                }

                CustomerManager customerObj = new CustomerManager();
                if (customerObj.GetCustomerDetails(currentUser.CompanyID, string.IsNullOrEmpty(customerID) ? 0 : Convert.ToInt32(customerID), currentUser.UserId,
                                                   out CustomerDetails))
                {
                    CustomerDetails.ErrorCode    = 0;
                    CustomerDetails.ErrorMessage = "";
                }
                else
                {
                    CustomerDetails.ErrorCode    = customerObj.GetLastErrorCode();
                    CustomerDetails.ErrorMessage = customerObj.GetLastError();
                }
            }
            catch (Exception ex)
            {
                Utils.Write(ex);
            }

            return(CustomerDetails);
        }
        public static Struct_Employee GetEmployeeMasterDetails(string EmployeeID)
        {
            Struct_Employee empl = new Struct_Employee();
            LoginUser       currentUser;

            try
            {
                if (!GetUserSession(out currentUser))
                {
                    empl.errorCode    = 1001;
                    empl.errorMessage = "";
                    return(empl);
                }

                AdminManagerSP adminObj = new AdminManagerSP();
                if (!adminObj.GetEmployeeMasterDetails(currentUser.CompanyID, currentUser.UserId, string.IsNullOrEmpty(EmployeeID) ? 0 : Convert.ToInt32(EmployeeID), out empl))
                {
                    empl.errorCode    = adminObj.GetLastErrorCode();
                    empl.errorMessage = adminObj.GetLastError();
                }
            }
            catch (Exception ex)
            {
                empl.errorCode    = -4;
                empl.errorMessage = "Unknown Error Occured";
                Utils.Write(ex);
            }

            return(empl);
        }
        public static JsonResults AddEditItemToDB(ItemMaster ItemMaster, int itemMasterID)
        {
            JsonResults returnObj = new JsonResults();
            LoginUser   currentUser;

            try
            {
                if (!GetUserSession(out currentUser))
                {
                    returnObj.ErrorCode    = -1001;
                    returnObj.ErrorMessage = "";
                }

                AdminManagerSP customerObj = new AdminManagerSP();
                if (customerObj.AddEditItemMaster(currentUser.CompanyID, currentUser.UserId, currentUser.UserBranchID, itemMasterID, ref ItemMaster))
                {
                    returnObj.ErrorCode    = 0;
                    returnObj.ErrorMessage = "";
                }
                else
                {
                    returnObj.ErrorCode    = customerObj.GetLastErrorCode();
                    returnObj.ErrorMessage = customerObj.GetLastError();
                }
            }
            catch (Exception ex)
            {
                Utils.Write(ex);
            }

            return(returnObj);
        }
        public static JsonResults GetPincodeDetails(string pincode)
        {
            JsonResults plist = new JsonResults();
            LoginUser   currentUser;

            try
            {
                if (!GetUserSession(out currentUser))
                {
                    plist.ErrorCode    = 1001;
                    plist.ErrorMessage = "";
                    return(plist);
                }

                AdminManagerSP adminObj = new AdminManagerSP();
                if (!adminObj.GetPincodeDetails(currentUser.CompanyID, currentUser.UserId, pincode, out plist))
                {
                    plist.ErrorCode    = adminObj.GetLastErrorCode();
                    plist.ErrorMessage = adminObj.GetLastError();
                }
            }
            catch (Exception ex)
            {
                plist.ErrorCode    = -4;
                plist.ErrorMessage = "Unknown Error Occured";
                Utils.Write(ex);
            }

            return(plist);
        }
示例#15
0
        public static JsonResults GetCompanyInfo()
        {
            JsonResults Measur = new JsonResults();
            LoginUser   currentUser;

            try
            {
                if (!GetUserSession(out currentUser))
                {
                    Measur.ErrorCode    = 1001;
                    Measur.ErrorMessage = "";
                    return(Measur);
                }

                CustomerManager adminObj = new CustomerManager();
                if (!adminObj.GetCompanyHeaderInfo(currentUser.CompanyID, currentUser.UserId, currentUser.UserBranchID, out Measur))
                {
                    Measur.ErrorCode    = adminObj.GetLastErrorCode();
                    Measur.ErrorMessage = adminObj.GetLastError();
                }
            }
            catch (Exception ex)
            {
                Measur.ErrorCode    = -4;
                Measur.ErrorMessage = "Unknown Error Occured";
                Utils.Write(ex);
            }

            return(Measur);
        }
        public static GenericPickList GetItemGroups()
        {
            GenericPickList returnObj = new GenericPickList();
            LoginUser       currentUser;

            try
            {
                if (!GetUserSession(out currentUser))
                {
                    returnObj.ErrorCode    = -1001;
                    returnObj.ErrorMessage = "";
                }

                CustomerManager customerObj = new CustomerManager();
                if (customerObj.GetPickLists(currentUser.CompanyID, currentUser.UserId, "ItemMasterGroup", out returnObj))
                {
                    returnObj.ErrorCode    = 0;
                    returnObj.ErrorMessage = "";
                }
                else
                {
                    returnObj.ErrorCode    = customerObj.GetLastErrorCode();
                    returnObj.ErrorMessage = customerObj.GetLastError();
                }
            }
            catch (Exception ex)
            {
                Utils.Write(ex);
            }

            return(returnObj);
        }
示例#17
0
        public void updateAttributes(List <KeyValuePair <string, string> > sSportData)
        {
            string strRoutineName = "updateAttributes";

            try
            {
                if (sSportData != null && sSportData.Count > 0)
                {
                    foreach (KeyValuePair <string, string> sSportkp in sSportData)
                    {
                        Utils.Write(VerboseLevel.DEBUG, "{0} {1} ", sSportkp.Key, sSportkp.Value);
                        try
                        {
                            if (this.GetType().GetProperty(sSportkp.Key) != null)
                            {
                                this.GetType().GetProperty(sSportkp.Key).SetValue(this, sSportkp.Value);
                            }
                        }
                        catch (System.NullReferenceException)
                        {
                            Utils.WriteLine(VerboseLevel.WARNING, "Field doesn't exist. XML and class fields mismatch!!! key: {0} value:{1}", sSportkp.Key, sSportkp.Value);
                        }
                    }
                    Utils.Write(VerboseLevel.DEBUG, "\n");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(strRoutineName + ": " + "Error: " + ex.Message.ToString(), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            //Not Used: uciec.lblMain.Text += slaveNum;
        }
示例#18
0
        public static JsonResults AddNewCustomerToDB(Customer Customer, CustomerAccount CustomerAccountObj)
        {
            JsonResults returnObj = new JsonResults();
            LoginUser   currentUser;

            try
            {
                if (!GetUserSession(out currentUser))
                {
                    returnObj.ErrorCode    = -1001;
                    returnObj.ErrorMessage = "";
                }

                CustomerManager customerObj = new CustomerManager();
                if (customerObj.AddNewCustomer(currentUser.CompanyID, currentUser.UserId, currentUser.UserBranchID, ref Customer, ref CustomerAccountObj))
                {
                    returnObj.ErrorCode    = 0;
                    returnObj.ErrorMessage = "";
                }
                else
                {
                    returnObj.ErrorCode    = customerObj.GetLastErrorCode();
                    returnObj.ErrorMessage = customerObj.GetLastError();
                }
            }
            catch (Exception ex)
            {
                Utils.Write(ex);
            }

            return(returnObj);
        }
示例#19
0
        protected void btn_Upload_Click(object sender, EventArgs e)
        {
            try
            {
                //Audit Log Purpose

                string sFile         = UploadingFileName_Txt.Value.Trim();
                string fileExtension = System.IO.Path.GetExtension(sFile);
                if (fileExtension == ".jpg" || fileExtension == ".tif" || fileExtension == ".png" || fileExtension == ".gif")
                {
                    Random rand = new Random();
                    //string fileStr = System.Configuration.ConfigurationManager.AppSettings.Get("TempLogoFolder") + "\\" + CURRENT_USER.CompanyID + "\\";

                    //if (!System.IO.Directory.Exists(fileStr))
                    //    System.IO.Directory.CreateDirectory(fileStr);

                    //fileStr += "\\" + Session.SessionID.ToString() + "_" + rand.Next().ToString() + ".xls";
                    //if (sFile.Length > 0)
                    //    UploadingFileName_Txt.PostedFile.SaveAs(fileStr);

                    HttpPostedFile sPath        = UploadingFileName_Txt.PostedFile;
                    string         fileName     = Path.GetFileName(sPath.FileName);
                    Stream         stream       = sPath.InputStream;
                    BinaryReader   binaryReader = new BinaryReader(stream);

                    //System.Drawing.Image FullsizeImage = System.Drawing.Image.FromFile(fileStr);
                    //ImageFile = GetResizedImage(FullsizeImage, 225, 80);
                    byte[] ImageBinaryFile = binaryReader.ReadBytes((int)stream.Length);// (UploadingFileName_Txt.PostedFile);

                    //using (System.IO.MemoryStream streamReader = new System.IO.MemoryStream())
                    //{
                    //    ImageFile.Save(streamReader, System.Drawing.Imaging.ImageFormat.Png);
                    //    streamReader.Position = 0;
                    //    ImageBinaryFile = new byte[streamReader.Length];
                    //    streamReader.Read(ImageBinaryFile, 0, ImageBinaryFile.Length);
                    //    streamReader.Close();
                    //}

                    SetLogo(ImageBinaryFile, System.IO.Path.GetFileName(sFile));

                    //if (System.IO.File.Exists(fileStr))
                    //    System.IO.File.Delete(fileStr);

                    //string base64ImageData = Convert.ToBase64String(ImageBinaryFile, 0, ImageBinaryFile.Length);

                    // img_Logo.ImageUrl="data:image/png;base64," + base64ImageData;
                    Utils.ShowAlert(this, "Company Logo Updated Successfully.");
                    btn_Remove.Visible = true;
                }
                else
                {
                    Utils.ShowAlert(this, "Please choose a valid Image File like JPG, TIF, PNG, GIF, etc.");
                }
            }
            catch (Exception ee)
            {
                Utils.Write(ee);
                Utils.ShowAlert(this, ee.ToString());
            }
        }
示例#20
0
        public MD(string mdName, List <KeyValuePair <string, string> > mdData)
        {
            rnName = mdName;

            //Parse n store values...
            if (mdData != null && mdData.Count > 0)
            {
                foreach (KeyValuePair <string, string> mdkp in mdData)
                {
                    Utils.Write(VerboseLevel.DEBUG, "{0} {1} ", mdkp.Key, mdkp.Value);
                    try
                    {
                        if (this.GetType().GetProperty(mdkp.Key) != null) //Ajay: 03/07/2018
                        {
                            this.GetType().GetProperty(mdkp.Key).SetValue(this, mdkp.Value);
                        }
                    }
                    catch (System.NullReferenceException)
                    {
                        Utils.WriteLine(VerboseLevel.WARNING, "Field doesn't exist. XML and class fields mismatch!!! key: {0} value: {1}", mdkp.Key, mdkp.Value);
                    }
                }
                Utils.Write(VerboseLevel.DEBUG, "\n");
            }
        }
示例#21
0
        public SMSSlave(string mbsName, List <KeyValuePair <string, string> > mbsData, TreeNode tn)
        {
            string strRoutineName = "SMSSlave";

            UFSMS.btnAddClick            += new System.EventHandler(this.btnAdd_Click);
            UFSMS.btnDeleteClick         += new System.EventHandler(this.btnDelete_Click);
            UFSMS.btnDoneClick           += new System.EventHandler(this.btnDone_Click);
            UFSMS.btnCancelClick         += new System.EventHandler(this.btnCancel_Click);
            UFSMS.btnFirstClick          += new System.EventHandler(this.btnFirst_Click);
            UFSMS.btnPrevClick           += new System.EventHandler(this.btnPrev_Click);
            UFSMS.btnNextClick           += new System.EventHandler(this.btnNext_Click);
            UFSMS.btnLastClick           += new System.EventHandler(this.btnLast_Click);
            UFSMS.lvUFSMSListItemCheck   += new System.Windows.Forms.ItemCheckEventHandler(this.lvUFSMSList_ItemCheck);
            UFSMS.lvUFSMSListDoubleClick += new System.EventHandler(this.lvUFSMSList_DoubleClick);
            addListHeaders();
            try
            {
                try
                {
                    sType = (slaveType)Enum.Parse(typeof(slaveType), mbsName);
                }
                catch (System.ArgumentException)
                {
                    Utils.WriteLine(VerboseLevel.WARNING, "Enum argument {0} not supported!!!", mbsName);
                }
                if (mbsData != null && mbsData.Count > 0)
                {
                    foreach (KeyValuePair <string, string> mbskp in mbsData)
                    {
                        Utils.Write(VerboseLevel.DEBUG, "{0} {1} ", mbskp.Key, mbskp.Value);
                        try
                        {
                            if (this.GetType().GetProperty(mbskp.Key) != null) //Ajay: 03/07/2018
                            {
                                this.GetType().GetProperty(mbskp.Key).SetValue(this, mbskp.Value);
                            }
                        }
                        catch (System.NullReferenceException)
                        {
                            Utils.WriteLine(VerboseLevel.WARNING, "Field doesn't exist. XML and class fields mismatch!!! key: {0} value:{1}", mbskp.Key, mbskp.Value);
                        }
                    }
                    Utils.Write(VerboseLevel.DEBUG, "\n");
                    if (tn != null)
                    {
                        tn.Nodes.Clear();
                    }
                    SMSSlaveTreeNode = tn;//Save local copy so we can use it to manually add nodes in above constructor...
                    if (tn != null)
                    {
                        tn.Text = "SMSSlave " + "SMSSlave_" + this.SlaveNum;
                    }
                    Utils.SMSSlaveTreeNode = tn;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(strRoutineName + ": " + "Error: " + ex.Message.ToString(), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        public static JsonResults GetItemRatesList(int ItemMasterID, int ItemRateID)
        {
            JsonResults invoiceList = new JsonResults();
            LoginUser   currentUser;

            try
            {
                if (!GetUserSession(out currentUser))
                {
                    invoiceList.ErrorCode    = -1001;
                    invoiceList.ErrorMessage = "";
                }

                CustomerManager customerObj = new CustomerManager();
                if (customerObj.GetItemMasterRates(currentUser.CompanyID, currentUser.UserId, ItemMasterID, ItemRateID, out invoiceList))
                {
                    invoiceList.ErrorCode    = 0;
                    invoiceList.ErrorMessage = "";
                }
                else
                {
                    invoiceList.ErrorCode    = -1;
                    invoiceList.ErrorMessage = "Failed to get Item Rates. please try again later";
                }
            }
            catch (Exception ex)
            {
                Utils.Write(ex);
            }

            return(invoiceList);
        }
示例#23
0
    /// <summary>
    /// Writes the value in the packet
    /// </summary>
    /// <param name="values">values to write</param>
    public void Write(char[] values)
    {
        int n = Utils.Write(Data, CurrentSeek, values);

        CurrentSeek   += n;
        CurrentLength += n;
    }
        public static JsonResults AddEditItemRate(string StartDate, string ItemPrice, int ItemRateID, int itemMasterID, string TotalGST,
                                                  string SGSTPer, string SGST, string CGSTPer, string CGST, string BillAmt)
        {
            JsonResults invoiceList = new JsonResults();
            LoginUser   currentUser;

            try
            {
                if (!GetUserSession(out currentUser))
                {
                    invoiceList.ErrorCode    = -1001;
                    invoiceList.ErrorMessage = "";
                }

                AdminManagerSP customerObj = new AdminManagerSP();
                if (customerObj.AddEditItemRate(currentUser.CompanyID, currentUser.UserId, ItemRateID, itemMasterID, ItemPrice, StartDate, string.IsNullOrEmpty(TotalGST) ? 0 : Convert.ToSingle(TotalGST),
                                                string.IsNullOrEmpty(SGSTPer) ? 0 : Convert.ToSingle(SGSTPer), string.IsNullOrEmpty(SGST) ? 0 : Convert.ToSingle(SGST), string.IsNullOrEmpty(CGSTPer) ? 0 : Convert.ToSingle(CGSTPer),
                                                string.IsNullOrEmpty(CGST) ? 0 : Convert.ToSingle(CGST), string.IsNullOrEmpty(BillAmt) ? 0 : Convert.ToSingle(BillAmt)))
                {
                    invoiceList.ErrorCode    = 0;
                    invoiceList.ErrorMessage = "";
                }
                else
                {
                    invoiceList.ErrorCode    = customerObj.GetLastErrorCode();
                    invoiceList.ErrorMessage = customerObj.GetLastError();
                }
            }
            catch (Exception ex)
            {
                Utils.Write(ex);
            }

            return(invoiceList);
        }
示例#25
0
文件: DP.cs 项目: Namrata2392/OPP
 public DP(XmlNode dNode)
 {
     SetSupportedOperations();
     //Parse n store values...
     Utils.WriteLine(VerboseLevel.DEBUG, "dNode name: '{0}' {1}", dNode.Name, dNode.Value);
     rnName = dNode.Name;
     if (dNode.Attributes != null)
     {
         foreach (XmlAttribute item in dNode.Attributes)
         {
             Utils.Write(VerboseLevel.DEBUG, "{0} {1} ", item.Name, item.Value);
             try
             {
                 if (this.GetType().GetProperty(item.Name) != null) //Ajay: 03/07/2018
                 {
                     this.GetType().GetProperty(item.Name).SetValue(this, item.Value);
                 }
             }
             catch (System.NullReferenceException)
             {
                 Utils.WriteLine(VerboseLevel.WARNING, "Field doesn't exist. XML and class fields mismatch!!! key: {0} value: {1}", item.Name, item.Value);
             }
         }
         Utils.Write(VerboseLevel.DEBUG, "\n");
     }
     else if (dNode.NodeType == XmlNodeType.Comment)
     {
         isNodeComment = true;
         comment       = dNode.Value;
     }
 }
        public static ItemMasterList GetItemDetails(int itemMasterID)
        {
            ItemMasterList returnObj = new ItemMasterList();
            LoginUser      currentUser;

            try
            {
                if (!GetUserSession(out currentUser))
                {
                    returnObj.ErrorCode    = -1001;
                    returnObj.ErrorMessage = "";
                }

                AdminManagerSP customerObj = new AdminManagerSP();
                if (customerObj.GetItemMasterList(currentUser.CompanyID, currentUser.UserId, itemMasterID, out returnObj))
                {
                    returnObj.ErrorCode    = 0;
                    returnObj.ErrorMessage = "";
                }
                else
                {
                    returnObj.ErrorCode    = -1;
                    returnObj.ErrorMessage = "Failed to get Item Details. please try again later";
                }
            }
            catch (Exception ex)
            {
                Utils.Write(ex);
            }

            return(returnObj);
        }
示例#27
0
 public byte[] GetBytes(ID3v2TagVersion tagVersion)
 {
     if ((this.m_AdditionalData == null) && (this.m_AdditionalData.Length == 0))
     {
         return(new byte[0]);
     }
     if (tagVersion == ID3v2TagVersion.ID3v22)
     {
         if ((this.m_FrameIdentifier == null) || (this.m_FrameIdentifier.Length != 3))
         {
             return(new byte[0]);
         }
     }
     else if ((this.m_FrameIdentifier == null) || (this.m_FrameIdentifier.Length != 4))
     {
         return(new byte[0]);
     }
     using (MemoryStream stream1 = new MemoryStream())
     {
         Utils.Write(stream1, Utils.ISO88591GetBytes(this.m_FrameIdentifier));
         Utils.Write(stream1, Utils.GetStringBytes(tagVersion, EncodingType.ISO88591, this.m_Url, true));
         Utils.Write(stream1, this.m_AdditionalData);
         return(this.m_FrameHeader.GetBytes(stream1, tagVersion, this.GetFrameID(tagVersion)));
     }
 }
示例#28
0
        public DD(string ddName, List <KeyValuePair <string, string> > ddData)
        {
            string strRoutineName = "DD";

            try
            {
                SetSupportedOperations();
                rnName = ddName;
                //Parse n store values...
                if (ddData != null && ddData.Count > 0)
                {
                    foreach (KeyValuePair <string, string> ddkp in ddData)
                    {
                        Utils.Write(VerboseLevel.DEBUG, "{0} {1} ", ddkp.Key, ddkp.Value);
                        try
                        {
                            if (this.GetType().GetProperty(ddkp.Key) != null) //Ajay: 03/07/2018
                            {
                                this.GetType().GetProperty(ddkp.Key).SetValue(this, ddkp.Value);
                            }
                        }
                        catch (System.NullReferenceException)
                        {
                            Utils.WriteLine(VerboseLevel.WARNING, "Field doesn't exist. XML and class fields mismatch!!! key: {0} value: {1}", ddkp.Key, ddkp.Value);
                        }
                    }
                    Utils.Write(VerboseLevel.DEBUG, "\n");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(strRoutineName + ": " + "Error: " + ex.Message.ToString(), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        public static JsonResults GetAccountList()
        {
            JsonResults returnObj = new JsonResults();
            LoginUser   currentUser;

            try
            {
                if (!GetUserSession(out currentUser))
                {
                    returnObj.ErrorCode    = 1001;
                    returnObj.ErrorMessage = "";
                    return(returnObj);
                }

                CustomerManager customerObj = new CustomerManager();
                if (customerObj.GetAccountList(currentUser.CompanyID, currentUser.UserId, out returnObj))
                {
                    returnObj.ErrorCode    = 0;
                    returnObj.ErrorMessage = "";
                }
                else
                {
                    returnObj.ErrorCode    = -1;
                    returnObj.ErrorMessage = "Failed to get Account List. please try again later";
                }
            }
            catch (Exception ex)
            {
                Utils.Write(ex);
            }

            return(returnObj);
        }
        public static CustomerPickLists GetCustomerPickLists(string customerID)
        {
            CustomerPickLists customerMasterPickLists = new CustomerPickLists();
            LoginUser         currentUser;

            try
            {
                if (!GetUserSession(out currentUser))
                {
                    customerMasterPickLists.ErrorCode    = -1001;
                    customerMasterPickLists.ErrorMessage = "";
                }

                CustomerManager customerObj = new CustomerManager();
                if (customerObj.GetCustomerPickLists(currentUser.CompanyID, string.IsNullOrEmpty(customerID) ? 0 : Convert.ToInt32(customerID), currentUser.UserId,
                                                     out customerMasterPickLists))
                {
                    customerMasterPickLists.ErrorCode    = 0;
                    customerMasterPickLists.ErrorMessage = "";
                }
                else
                {
                    customerMasterPickLists.ErrorCode    = -1;
                    customerMasterPickLists.ErrorMessage = "Failed to get dropdowns. please try again later";
                }
            }
            catch (Exception ex)
            {
                Utils.Write(ex);
            }

            return(customerMasterPickLists);
        }
示例#31
0
 /// <summary>
 /// 序列化
 /// </summary>
 /// <param name="formatter"></param>
 public void Write(Utils.IFormatter formatter)
 {
     formatter.Write(this.Scheme);
     formatter.Write(this.ID);
 }
示例#32
0
 /// <summary>
 /// write
 /// </summary>
 /// <param name="formatter"></param>
 public void Write(Utils.IFormatter formatter)
 {
     formatter.Write(this.Path);
     formatter.Write(this.Acl);
     formatter.Write(this.Version);
 }
示例#33
0
 /// <summary>
 /// 序列化
 /// </summary>
 /// <param name="formatter"></param>
 public void Write(Utils.IFormatter formatter)
 {
     formatter.Write((int)this.Perms);
     formatter.Write(this.ID);
 }