Exemplo n.º 1
0
        private void GLCashCode()
        {
            string    qry    = "SELECT Ids,NewCashCode,OldCashCode FROM wfCashCode ";
            DataTable dt     = DataAccessLayer.BLL.CommonManager.Instance.GetDataTableByQuery(qry, "A2ZCSMCUS");
            int       totrec = dt.Rows.Count;

            if (dt.Rows.Count > 0)
            {
                foreach (DataRow dr in dt.Rows)
                {
                    var NewCashCode = dr["NewCashCode"].ToString();
                    var OldCashCode = dr["OldCashCode"].ToString();

                    int       code = Converter.GetInteger(OldCashCode);
                    string    qry1 = "SELECT Id FROM A2ZCUNION WHERE GLCASHCODE='" + code + "'";
                    DataTable dt1  = DataAccessLayer.BLL.CommonManager.Instance.GetDataTableByQuery(qry1, "A2ZCSMCUS");
                    if (dt1.Rows.Count > 0)
                    {
                        foreach (DataRow dr1 in dt1.Rows)
                        {
                            var          ParentId = dr1["Id"].ToString();
                            A2ZCUNIONDTO objDTO   = new A2ZCUNIONDTO();
                            objDTO.ID = Converter.GetSmallInteger(ParentId);

                            objDTO.GLCashCode = Converter.GetInteger(NewCashCode);
                            int row2 = A2ZCUNIONDTO.Update1(objDTO);
                        }
                    }
                }
            }
        }