public void GetOrderData() { string cs = ConfigurationManager.ConnectionStrings["CN"].ConnectionString; List <ORDMAN> order = new List <ORDMAN>(); using (SqlConnection con = new SqlConnection(cs)) { //string sql = ""; //sql = " SELECT ORDMAN.*,CONVERT(VARCHAR,ORDMAN.ORDT ,103) AS DATE,ACCMST.NAME AS ACNM,PADDMST.NAME AS CONPTY,PADDMST.ADDR AS CONADD,REFMST.NAME AS AGNM,FINITMMST.NAME AS ITNM,TAXMST.NAME AS STAX,SUBDEALER.NAME AS SUBDEALER FROM ORDMAN LEFT JOIN REFMST ON REFMST.CODE=ORDMAN.BRCD AND REFMST.CATA='B' INNER JOIN ACCMST ON ACCMST.CODE=ORDMAN.PCOD LEFT JOIN PADDMST ON PADDMST.CODE=ORDMAN.DCODE AND PADDMST.SRNO=ORDMAN.ADDR LEFT JOIN TAXMST ON TAXMST.CODE=ORDMAN.TXCD INNER JOIN FINITMMST ON FINITMMST.COMP=ORDMAN.COMP AND FINITMMST.UNIT=ORDMAN.UNIT AND FINITMMST.DVCD=ORDMAN.DCOD AND FINITMMST.CODE=ORDMAN.ICOD LEFT JOIN REFMST SUBDEALER ON SUBDEALER.CODE=ORDMAN.TBRCD AND SUBDEALER.CATA='B' WHERE ORDMAN.FIN_APRV='N' AND ORDMAN.VP_APRV='N' "; SqlCommand cmd = new SqlCommand("SELECT DISTINCT COMP,UNIT,DCOD,DBCD,ORDT,ORDN,PCOD,TXCD,BRCD,QNTY FROM ORDMAN WHERE COMP ='0001' AND UNIT ='000001'", con); cmd.CommandType = CommandType.Text; con.Open(); SqlDataReader rdr = cmd.ExecuteReader(); while (rdr.Read()) { ORDMAN ord = new ORDMAN(); ord.ORDT = Convert.ToDateTime(rdr["ORDT"]); ord.ORDN = rdr["ORDN"].ToString(); ord.PCOD = rdr["PCOD"].ToString(); ord.TXCD = rdr["TXCD"].ToString(); ord.BRCD = rdr["BRCD"].ToString(); //ord.QNTY = Convert.ToInt32(rdr["QNTY"]); order.Add(ord); } } JavaScriptSerializer js = new JavaScriptSerializer(); Context.Response.Write(js.Serialize(order)); }
//public static List<Employees> GetEmployee() public void GetOrderData() { string cs = ConfigurationManager.ConnectionStrings["CN"].ConnectionString; List <ORDMAN> order = new List <ORDMAN>(); using (SqlConnection con = new SqlConnection(cs)) { SqlCommand cmd = new SqlCommand("SELECT ORDMAN.COMP,ORDMAN.UNIT,ORDMAN.DCOD,ORDMAN.DBCD,ORDMAN.BRCD,ORDMAN.PCOD,ORDMAN.TXCD,ORDMAN.DCODE,ORDMAN.ADDR,ORDT,ORDN,MAX(ORDMAN.PORD) AS PORD,ISNULL(SUM(ORDMAN.QNTY),0) AS QNTY,MAX(FINITMMST.NAME) AS ITEM,MAX(ACCMST.NAME) AS PARTY,MAX(TAXMST.NAME) AS TAXNAME ,MAX(REFMST.NAME) AS AGENT FROM ORDMAN LEFT JOIN FINITMMST ON ORDMAN.COMP = FINITMMST.COMP AND ORDMAN.UNIT = FINITMMST.UNIT AND ORDMAN.DCOD = FINITMMST.DVCD AND ORDMAN.ICOD = FINITMMST.CODE LEFT JOIN ACCMST ON ORDMAN.PCOD = ACCMST.CODE LEFT JOIN REFMST ON ORDMAN.BRCD = REFMST.CODE LEFT JOIN TAXMST ON ORDMAN.TXCD = TAXMST.CODE WHERE ORDMAN.COMP = '0001' AND FIN_APRV='N' GROUP BY ORDMAN.COMP, ORDMAN.UNIT, ORDMAN.DCOD, ORDT, ORDN,ORDMAN.DBCD,ORDMAN.BRCD,ORDMAN.PCOD,ORDMAN.TXCD,ORDMAN.DCODE,ORDMAN.ADDR", con); cmd.CommandType = CommandType.Text; con.Open(); SqlDataReader rdr = cmd.ExecuteReader(); while (rdr.Read()) { ORDMAN ord = new ORDMAN(); ord.ORDT = Convert.ToDateTime(rdr["ORDT"]); ord.ORDN = rdr["ORDN"].ToString(); ord.PARTY = rdr["PARTY"].ToString(); ord.QNTY = Convert.ToInt32(rdr["QNTY"]); ord.AGENT = rdr["AGENT"].ToString(); ord.UNIT = rdr["UNIT"].ToString(); ord.DCOD = rdr["DCOD"].ToString(); ord.DBCD = rdr["DBCD"].ToString(); ord.BRCD = rdr["BRCD"].ToString(); ord.TXCD = rdr["TXCD"].ToString(); ord.DCODE = rdr["DCODE"].ToString(); ord.ADDR = rdr["ADDR"].ToString(); ord.PORD = rdr["PORD"].ToString(); ord.PCOD = rdr["PCOD"].ToString(); //ord.QNTY = Convert.ToInt32(rdr["QNTY"]); order.Add(ord); } } JavaScriptSerializer js = new JavaScriptSerializer(); Context.Response.Write(js.Serialize(order)); }
public void GetordInfo(string ORDN, string UNIT) { string cs = ConfigurationManager.ConnectionStrings["CN"].ConnectionString; List <ORDMAN> ordernoo = new List <ORDMAN>(); using (SqlConnection con = new SqlConnection(cs)) { SqlCommand cmd = new SqlCommand("SELECT ORDMAN.COMP,ORDMAN.UNIT,ORDMAN.DCOD,ORDT,ORDN,TRCD,QNTY,ICOD,RATE,ARAT,FINITMMST.NAME AS ITEM,GRDMST.GRAD AS GRADE FROM ORDMAN LEFT JOIN FINITMMST ON ORDMAN.COMP = FINITMMST.COMP AND ORDMAN.UNIT = FINITMMST.UNIT AND ORDMAN.DCOD = FINITMMST.DVCD AND ORDMAN.ICOD = FINITMMST.CODE LEFT JOIN GRDMST ON ORDMAN.TRCD = GRDMST.CODE WHERE ORDMAN.COMP = '0001' AND ORDMAN.UNIT='" + UNIT + "' AND ORDMAN.ORDN ='" + ORDN + "' ", con); cmd.CommandType = CommandType.Text; con.Open(); SqlDataReader rdr = cmd.ExecuteReader(); while (rdr.Read()) { ORDMAN ordnn = new ORDMAN(); ordnn.ORDT = Convert.ToDateTime(rdr["ORDT"]); ordnn.ORDN = rdr["ORDN"].ToString(); ordnn.ITEM = rdr["ITEM"].ToString(); ordnn.ICOD = rdr["ICOD"].ToString(); ordnn.TRCD = rdr["TRCD"].ToString(); ordnn.QNTY = Convert.ToInt32(rdr["QNTY"]); ordnn.GRADE = rdr["GRADE"].ToString(); ordnn.RATE = Convert.ToInt32(rdr["RATE"]); ordnn.ARAT = Convert.ToInt32(rdr["ARAT"]); ordernoo.Add(ordnn); } } JavaScriptSerializer js = new JavaScriptSerializer(); Context.Response.Write(js.Serialize(ordernoo)); }
internal void Add(ORDMAN ord) { throw new NotImplementedException(); }