Exemple #1
0
        /// <summary>
        /// Function for view the copied Master details by form name
        /// </summary>
        /// <param name="formName"></param>
        /// <returns></returns>
        public MasterInfo MasterCopyViewByFormName(int formName)
        {
            MasterInfo infoMaster = new MasterInfo();

            try
            {
                if (sqlcon.State == ConnectionState.Closed)
                {
                    sqlcon.Open();
                }
                SqlCommand sqlcmd = new SqlCommand("MasterCopyViewByFormName", sqlcon);
                sqlcmd.CommandType = CommandType.StoredProcedure;
                sqlcmd.Parameters.Add("@formName", SqlDbType.Int).Value = formName;
                SqlDataReader sqldr = sqlcmd.ExecuteReader();
                while (sqldr.Read())
                {
                    infoMaster.MasterId            = int.Parse(sqldr["masterId"].ToString());
                    infoMaster.FormName            = int.Parse(sqldr["formName"].ToString());
                    infoMaster.IsTwoLineForHedder  = bool.Parse(sqldr["isTwoLineForHedder"].ToString());
                    infoMaster.IsTwoLineForDetails = bool.Parse(sqldr["isTwoLineForDetails"].ToString());
                    infoMaster.PageSize1           = int.Parse(sqldr["pageSize1"].ToString());
                    infoMaster.PageSizeOther       = int.Parse(sqldr["pageSizeOther"].ToString());
                    infoMaster.BlankLneForFooter   = int.Parse(sqldr["blankLneForFooter"].ToString());
                    infoMaster.FooterLocation      = sqldr["footerLocation"].ToString();
                    infoMaster.LineCountBetweenTwo = int.Parse(sqldr["lineCountBetweenTwo"].ToString());
                    infoMaster.Pitch               = sqldr["pitch"].ToString();
                    infoMaster.Condensed           = sqldr["condensed"].ToString();
                    infoMaster.LineCountAfterPrint = int.Parse(sqldr["lineCountAfterPrint"].ToString());
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "MasterViewByFormName", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                sqlcon.Close();
            }
            return(infoMaster);
        }